package com.ITXu.reggie.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ITXu.reggie.commom.R;
import com.ITXu.reggie.entity.Orders;
import com.ITXu.reggie.service.OrderDetailService;
import com.ITXu.reggie.service.OrderService;

import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/order")
@CrossOrigin
@Slf4j
public class OrderController {

	@Autowired
	private OrderService orderService;
	
	@PostMapping("/submit")
	public R<String> submit(@RequestBody Orders orders){
		orderService.submit(orders);
		return R.success("下单成功");
	}
}
